package models

import "time"

type Site struct {
	DomainName          string      `json:"domain_name"`
	RedirectHttps       bool        `json:"redirect_https"`
	InternalProtocol    string      `json:"internal_protocol"`
	HSTSEnabled         bool        `json:"hsts_enabled"`
	WAFEnabled          bool        `json:"waf_enabled"`
	ForceCAPTCHAEnabled bool        `json:"force_captcha_enabled"` //访问前强制人机验证
	SourceSite          *SourceSite `json:"source_site"`
	SiteCCPolicy        *CCPolicy   `json:"site_cc_policy"`
}

type SourceSite struct {
	IP   string `json:"ip"`
	Port string `json:"port"`
}

type CCPolicy struct {
	IntervalSeconds time.Duration `json:"interval_seconds"`
	MaxCount        int64         `json:"max_count"`
	BlockSeconds    time.Duration `json:"block_seconds"`
	Action          PolicyAction  `json:"action"` //可以选择100，200，300
}

type SiteAMParams struct {
	Domain          string `json:"domain"`
	RedirectHttps   string `json:"redirect_https"`
	HSTS            string `json:"hsts"`
	WAF             string `json:"waf"`
	SourcePort      string `json:"source_port"`
	SourceIP        string `json:"source_ip"`
	IntervalSeconds string `json:"interval_seconds"`
	MaxCount        string `json:"max_count"`
	BlockSeconds    string `json:"block_seconds"`
	CCAction        string `json:"cc_action"`
}

type FrontendTemplates struct {
	InvalidDomainPage string `json:"invalid_domain_page"`
	CCAttackBlockPage string `json:"cc_attack_block_page"`
}
